import java.util.Comparator;
import java.util.Map;
import java.text.*;
import java.util.*;
import java.io.*;

class ProbabilityComparator implements Comparator<Object>{
	    
	    Map<Object, Double> _map;
	    
	    ProbabilityComparator(Map<Object, Double> firstMap) { _map = firstMap; }
	    
	    public int compare(Object pred1, Object pred2){    
	        Double pred1Value = _map.get((String) pred1);        
	        Double pred2Value = _map.get((String) pred2);
	        if(pred2Value > pred1Value) return 1;
	        else if(pred2Value < pred1Value) return -1;
	        else return 0;    
	    }     

}
